package com.bank.dao;

import java.util.List;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.bank.pojo.BankNewsType;

@Component("newsTypeDao")
public class NewsTypeDao extends BaseDao{
	@Transactional
	public BankNewsType getTypeById(int nid){
		BankNewsType type=(BankNewsType)
						getSession().createQuery("from BankNewsType where newsTypeId=?").setInteger(0,nid).uniqueResult();
		return type;
	}
	
	@Transactional
	public List<BankNewsType> getAllType(){
		List<BankNewsType> list=getSession().createQuery("from BankNewsType").list();
		return list;
	}
}
